from .Block import BlockType, Enum

"""
建筑物类型
"""

class BuildingType(Enum):
    OAK_TREE = 0 # 树木
    DARK_RIP = 1 # 撕裂的峡谷
    BIRCH_TREE = 2 # 白杨树


OAK_TREE = [
    (BlockType.Log, (0, 0, 0)),
    (BlockType.Log, (0, 1, 0)),
    (BlockType.Log, (0, 2, 0)),
    (BlockType.Log, (0, 3, 0)),
    (BlockType.Log, (0, 4, 0)),

    (BlockType.Leave, (-2, 3, -2)),
    (BlockType.Leave, (-1, 3, -2)),
    (BlockType.Leave, (0, 3, -2)),
    (BlockType.Leave, (1, 3, -2)),

    (BlockType.Leave, (-2, 3, -1)),
    (BlockType.Leave, (-1, 3, -1)),
    (BlockType.Leave, (0, 3, -1)),
    (BlockType.Leave, (1, 3, -1)),
    (BlockType.Leave, (2, 3, -1)),

    (BlockType.Leave, (-2, 3, 0)),
    (BlockType.Leave, (-1, 3, 0)),
    (BlockType.Leave, (1, 3, 0)),
    (BlockType.Leave, (2, 3, 0)),

    (BlockType.Leave, (-2, 3, 1)),
    (BlockType.Leave, (-1, 3, 1)),
    (BlockType.Leave, (0, 3, 1)),
    (BlockType.Leave, (1, 3, 1)),
    (BlockType.Leave, (2, 3, 1)),

    (BlockType.Leave, (-1, 3, 2)),
    (BlockType.Leave, (0, 3, 2)),
    (BlockType.Leave, (1, 3, 2)),
    (BlockType.Leave, (2, 3, 2)),

    (BlockType.Leave, (-2, 4, -2)),
    (BlockType.Leave, (-1, 4, -2)),
    (BlockType.Leave, (0, 4, -2)),
    (BlockType.Leave, (1, 4, -2)),

    (BlockType.Leave, (-2, 4, -1)),
    (BlockType.Leave, (-1, 4, -1)),
    (BlockType.Leave, (0, 4, -1)),
    (BlockType.Leave, (1, 4, -1)),
    (BlockType.Leave, (2, 4, -1)),

    (BlockType.Leave, (-2, 4, 0)),
    (BlockType.Leave, (-1, 4, 0)),
    (BlockType.Leave, (1, 4, 0)),
    (BlockType.Leave, (2, 4, 0)),

    (BlockType.Leave, (-2, 4, 1)),
    (BlockType.Leave, (-1, 4, 1)),
    (BlockType.Leave, (0, 4, 1)),
    (BlockType.Leave, (1, 4, 1)),
    (BlockType.Leave, (2, 4, 1)),

    (BlockType.Leave, (-2, 4, 2)),
    (BlockType.Leave, (-1, 4, 2)),
    (BlockType.Leave, (0, 4, 2)),
    (BlockType.Leave, (1, 4, 2)),

    (BlockType.Leave, (-1, 5, 0)),
    (BlockType.Leave, (1, 5, 0)),
    (BlockType.Leave, (0, 5, -1)),
    (BlockType.Leave, (0, 5, 1)),
    (BlockType.Leave, (1, 5, 1)),
    (BlockType.Leave, (-1, 5, -1)),
    (BlockType.Leave, (-1, 5, 1)),
    (BlockType.Leave, (0, 5, 0)),

    (BlockType.Leave, (0, 6, 0)),
    (BlockType.Leave, (1, 6, 0)),
    (BlockType.Leave, (-1, 6, 0)),
    (BlockType.Leave, (0, 6, 1)),
    (BlockType.Leave, (0, 6, -1))
]

DARK_RIP = [
    (BlockType.CobbleStone, (0, 0, 0)),
    (BlockType.MossyCobbleStone, (1, 0, 0)),
    (BlockType.CobbleStone, (-1, 0, 0)),
    (BlockType.CobbleStone, (0, 0, 1)),
    (BlockType.CobbleStone, (0, 0, -1)),
    (BlockType.MossyCobbleStone, (1, 0, 1)),
    (BlockType.CobbleStone, (1, 0, -1)),
    (BlockType.MossyCobbleStone, (-1, 0, 1)),
    (BlockType.MossyCobbleStone, (-1, 0, -1)),

    (BlockType.MossyCobbleStone, (0, 1, 0)),
    (BlockType.CobbleStone, (1, 1, 0)),
    (BlockType.MossyCobbleStone, (-1, 1, 0)),
    (BlockType.CobbleStone, (0, 1, 1)),
    (BlockType.MossyCobbleStone, (0, 1, -1)),
    (BlockType.CobbleStone, (1, 1, 1)),
    (BlockType.MossyCobbleStone, (1, 1, -1)),
    (BlockType.CobbleStone, (-1, 1, 1)),
    (BlockType.CobbleStone, (-1, 1, -1)),

    (BlockType.MossyCobbleStone, (0, 2, 0)),
    (BlockType.CobbleStone, (1, 2, 0)),
    (BlockType.MossyCobbleStone, (-1, 2, 0)),
    (BlockType.MossyCobbleStone, (0, 2, 1)),
    (BlockType.MossyCobbleStone, (0, 2, -1)),
    (BlockType.CobbleStone, (-1, 2, 1)),
]

BIRCH_TREE = [
    (BlockType.BirchLog, (0, 0, 0)),
    (BlockType.BirchLog, (0, 1, 0)),
    (BlockType.BirchLog, (0, 2, 0)),
    (BlockType.BirchLog, (0, 3, 0)),
    (BlockType.BirchLog, (0, 4, 0)),

    (BlockType.Leave, (-2, 3, -2)),
    (BlockType.Leave, (-1, 3, -2)),
    (BlockType.Leave, (0, 3, -2)),
    (BlockType.Leave, (1, 3, -2)),

    (BlockType.Leave, (-2, 3, -1)),
    (BlockType.Leave, (-1, 3, -1)),
    (BlockType.Leave, (0, 3, -1)),
    (BlockType.Leave, (1, 3, -1)),
    (BlockType.Leave, (2, 3, -1)),

    (BlockType.Leave, (-2, 3, 0)),
    (BlockType.Leave, (-1, 3, 0)),
    (BlockType.Leave, (1, 3, 0)),
    (BlockType.Leave, (2, 3, 0)),

    (BlockType.Leave, (-2, 3, 1)),
    (BlockType.Leave, (-1, 3, 1)),
    (BlockType.Leave, (0, 3, 1)),
    (BlockType.Leave, (1, 3, 1)),
    (BlockType.Leave, (2, 3, 1)),

    (BlockType.Leave, (-1, 3, 2)),
    (BlockType.Leave, (0, 3, 2)),
    (BlockType.Leave, (1, 3, 2)),
    (BlockType.Leave, (2, 3, 2)),

    (BlockType.Leave, (-2, 4, -2)),
    (BlockType.Leave, (-1, 4, -2)),
    (BlockType.Leave, (0, 4, -2)),
    (BlockType.Leave, (1, 4, -2)),

    (BlockType.Leave, (-2, 4, -1)),
    (BlockType.Leave, (-1, 4, -1)),
    (BlockType.Leave, (0, 4, -1)),
    (BlockType.Leave, (1, 4, -1)),
    (BlockType.Leave, (2, 4, -1)),

    (BlockType.Leave, (-2, 4, 0)),
    (BlockType.Leave, (-1, 4, 0)),
    (BlockType.Leave, (1, 4, 0)),
    (BlockType.Leave, (2, 4, 0)),

    (BlockType.Leave, (-2, 4, 1)),
    (BlockType.Leave, (-1, 4, 1)),
    (BlockType.Leave, (0, 4, 1)),
    (BlockType.Leave, (1, 4, 1)),
    (BlockType.Leave, (2, 4, 1)),

    (BlockType.Leave, (-2, 4, 2)),
    (BlockType.Leave, (-1, 4, 2)),
    (BlockType.Leave, (0, 4, 2)),
    (BlockType.Leave, (1, 4, 2)),

    (BlockType.Leave, (-1, 5, 0)),
    (BlockType.Leave, (1, 5, 0)),
    (BlockType.Leave, (0, 5, -1)),
    (BlockType.Leave, (0, 5, 1)),
    (BlockType.Leave, (1, 5, 1)),
    (BlockType.Leave, (-1, 5, -1)),
    (BlockType.Leave, (-1, 5, 1)),
    (BlockType.Leave, (0, 5, 0)),

    (BlockType.Leave, (0, 6, 0)),
    (BlockType.Leave, (1, 6, 0)),
    (BlockType.Leave, (-1, 6, 0)),
    (BlockType.Leave, (0, 6, 1)),
    (BlockType.Leave, (0, 6, -1))
]


def get_building(building_type):
    return BUILDINGS[building_type.value]


BUILDINGS = [
    OAK_TREE,
    DARK_RIP,
    BIRCH_TREE,
]
